home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / configure.in < prev    next >
Encoding:
Text File  |  1993-05-21  |  4.7 KB  |  185 lines

  1. dnl Process this file with autoconf to produce a working configure script.
  2. AC_INIT(Makefile.in)
  3. AC_CONFIG_HEADER(include/tweak.h)
  4. AC_LN_S
  5. AC_PROG_CC
  6. AC_ISC_POSIX
  7. echo checking for DYNIX/ptx 
  8. FSP_PROGRAM_GREP(yes,
  9. [#if defined(_SEQUENT_)
  10.   yes
  11. #endif
  12. ], SEQUENT=1,)
  13. if test -n "$SEQUENT"; then
  14. EX_LIBS="-lsocket -linet -lnsl -lseq"
  15. PARALLEL_MAKE='\&'
  16. CC='cc'
  17. GCC=
  18. echo You"'"re on Sequent.. Using cc and parallel make
  19. fi
  20. echo checking for SunOS 5.1
  21. FSP_PROGRAM_GREP(yes,
  22. [#if defined(SVR4) && defined(SPARC)
  23.   yes
  24. #endif
  25. ], SUNOS51=1,)
  26. if test -n "$SUNOS51"; then
  27. EX_LIBS="-lsockect -lnsl"
  28. fi
  29. AC_SUBST(EX_LIBS)
  30. AC_SUBST(PARALLEL_MAKE)
  31. AC_AIX
  32. echo checking for DGUX
  33. FSP_PROGRAM_GREP(yes,
  34. [#if defined(DGUX)
  35.   yes
  36. #endif], DGUX=1,)
  37. AC_PROG_INSTALL
  38. AC_PROG_RANLIB
  39. AC_DIR_HEADER
  40. echo checking for ansi-style prototypes
  41. AC_TEST_PROGRAM([main(int argc,char **argv){exit(0);}],
  42.                 AC_DEFINE(HAVE_ANSI_PROTO),,)
  43. if test -n "$GCC"; then
  44. AC_DEFINE(HAVE_ANSI_PROTO)
  45. fi
  46. AC_STDC_HEADERS
  47. AC_HAVE_HEADERS(string.h memory.h strings.h)
  48. AC_LONG_FILE_NAMES
  49. echo checking for word sizes
  50. AC_TEST_PROGRAM([ main(){ exit(sizeof(unsigned)!=2); }], AC_DEFINE(SIZE_INT_2))
  51. AC_TEST_PROGRAM([ main(){ exit(sizeof(unsigned)!=4); }], AC_DEFINE(SIZE_INT_4))
  52. AC_TEST_PROGRAM([ main(){ exit(sizeof(short)!=2); }], AC_DEFINE(SIZE_SRT_2))
  53. AC_TEST_PROGRAM([ main(){ exit(sizeof(long)!=4); }], AC_DEFINE(SIZE_LNG_4))
  54. AC_UNISTD_H
  55. FSP_MODE_T
  56. FSP_PID_T
  57. FSP_SIZE_T
  58. FSP_UID_T
  59. FSP_NLINK_T
  60. AC_FUNC_CHECK(bsearch , , AC_DEFINE(bsearch, ansi_bsearch))
  61. AC_FUNC_CHECK(random , , AC_DEFINE(NEED_RANDOM))
  62. AC_FUNC_CHECK(strdup, , AC_DEFINE(NEED_STRDUP))
  63. AC_FUNC_CHECK(bcopy, , AC_DEFINE(NEED_BCOPY))
  64. AC_FUNC_CHECK(flock, AC_DEFINE(HAVE_FLOCK), )
  65. AC_FUNC_CHECK(lockf, AC_DEFINE(HAVE_LOCKF), )
  66. echo checking for shmget
  67. LOCKPATH="conftestlock"
  68. AC_TEST_PROGRAM([
  69. #include <sys/types.h>
  70. #include <fcntl.h>
  71. #include <sys/ipc.h>
  72. #include <sys/shm.h>
  73. #define LOCKPATH "$LOCKPATH"
  74.  
  75. main() {
  76.   key_t ky;
  77.   int   sh, rv, fd;
  78.  
  79.   fd = open(LOCKPATH, O_RDWR | O_CREAT, 0666);
  80.   if (fd == -1) exit(1);
  81.   rv = 0;
  82.   ky = ftok(LOCKPATH, 2001);
  83.   if (ky == (key_t) -1) rv = 1;
  84.   else {
  85.     struct shmid_ds foo;
  86.     sh = shmget(ky, 1, IPC_CREAT | 0666);
  87.     if (sh == -1) rv = 1;
  88.     else shmctl(sh, IPC_RMID, &foo);
  89.   }
  90.   close(fd);
  91.   exit(rv); }], AC_DEFINE(HAVE_SHMEM))
  92. rm -f $LOCKPATH conftest.c
  93. AC_COMPILE_CHECK(d_ino, [#ifdef DIRENT
  94. #include <dirent.h>
  95. #else
  96. #ifdef SYSDIR
  97. #include <sys/dir.h>
  98. #else
  99. #ifdef SYSNDIR
  100. #include <sys/ndir.h>
  101. #endif
  102. #endif
  103. #endif], [
  104. #ifdef DIRENT
  105. struct dirent *dp;
  106. #else
  107. struct direct *dp;
  108. #endif
  109. int a ; a=dp->d_ino;], AC_DEFINE(HAVE_D_INO), )
  110. AC_COMPILE_CHECK(d_fileno, [#ifdef DIRENT
  111. #include <dirent.h>
  112. #else
  113. #ifdef SYSDIR
  114. #include <sys/dir.h>
  115. #else
  116. #ifdef SYSNDIR
  117. #include <sys/ndir.h>
  118. #endif
  119. #endif
  120. #endif], [
  121. #ifdef DIRENT
  122. struct dirent *dp;
  123. #else
  124. struct direct *dp;
  125. #endif
  126. int a ; a=dp->d_fileno;], AC_DEFINE(HAVE_D_FILENO), )
  127. if test -z "$DGUX"; then
  128. AC_COMPILE_CHECK(union wait,[#include <sys/types.h>
  129. #include <sys/wait.h>
  130. ], [union wait u ; ], AC_DEFINE(HAVE_UNION_WAIT),)
  131. fi
  132. AC_COMPILE_CHECK(WEXITSTATUS, [#ifdef HAVE_UNISTD_H
  133. #ifndef __hpux
  134. #include <unistd.h>
  135. #endif
  136. #endif
  137. #include <sys/types.h>
  138. #include <sys/wait.h>], [
  139. #if defined(HAVE_UNION_WAIT) && !defined(__hpux)
  140. union wait foo;
  141. #else
  142. int foo;
  143. #endif
  144. WEXITSTATUS(foo);], AC_DEFINE(HAVE_WEXITSTATUS), )
  145. AC_COMPILE_CHECK(S_ISREG, [#include <sys/types.h>
  146. #include <sys/stat.h>],
  147.          [struct stat sb; return S_ISREG(sb.st_mode);],
  148.          AC_DEFINE(HAVE_S_ISREG), )
  149. AC_COMPILE_CHECK(S_ISDIR, [#include <sys/types.h>
  150. #include <sys/stat.h>],
  151.          [struct stat sb; return S_ISDIR(sb.st_mode);],
  152.          AC_DEFINE(HAVE_S_ISDIR), )
  153. AC_HEADER_CHECK(tzfile.h, [TZFILE_H=1
  154. AC_DEFINE(HAVE_TZFILE_H)],
  155.         [AC_DEFINE(USE_SECSPERDAY, (long)60*60*24)
  156.          AC_DEFINE(USE_DAYSPERNYEAR, 365)])
  157. if test -n "$TZFILE_H"; then
  158. AC_COMPILE_CHECK(SECSPERDAY, [#include <tzfile.h>], [long b = SECSPERDAY;],
  159.          AC_DEFINE(HAVE_SECSPERDAY),
  160.          [AC_COMPILE_CHECK(SECS_PER_DAY, [#include <tzfile.h>],
  161.                    [long b = SECS_PER_DAY;],
  162.                    AC_DEFINE(USE_SECSPERDAY, SECS_PER_DAY),
  163.                    AC_DEFINE(USE_SECSPERDAY, (long)60*60*24))])
  164. AC_COMPILE_CHECK(DAYSPERNYEAR, [#include <tzfile.h>], [int b = DAYSPERNYEAR;],
  165.          AC_DEFINE(HAVE_DAYSPERNYEAR),
  166.          [AC_COMPILE_CHECK(DAYS_PER_NYEAR, [#include <tzfile.h>],
  167.                    [int b = DAYS_PER_NYEAR;],
  168.                    AC_DEFINE(USE_DAYSPERNYEAR, DAYS_PER_NYEAR),
  169.                    AC_DEFINE(USE_DAYSPERNYEAR, 365))])
  170. fi
  171. echo checking for string.h declaring some functions incorrectly
  172. echo "$DEFS
  173. #include <sys/types.h>
  174. #include <string.h>
  175. " > conftest.c
  176. $CC conftest.c -o conftest $LIBS > conftest.out 2>&1
  177. if grep "conflicting types for built-in function" conftest.out >/dev/null; then AC_DEFINE(STRING_H_BOGUS)
  178. fi
  179. rm -f conftest*
  180. AC_VPRINTF
  181. if test -z "$GCC"; then
  182.   AC_CONST
  183. fi
  184. AC_OUTPUT(Makefile)
  185.